#!/bin/bash
###########################first edit network hostname yum makecache ###############################

n=0
m=0
filenameshow=0

###################   rename network name!



#echo "$filenameshow rename eth(?)"
#read -p "?=" n

#filenameshow=eth$n

##################    change eth set


echo "Please input network eth(IPADDR),if you dont know,you will try ifconfig -a"
read -p "IPADDR=10.0.0.* 172.16.1.*   *.*.*.?" m


sed -i  s#IPADDR=.*#IPADDR=10.0.0.$m#g /etc/sysconfig/network-scripts/ifcfg-eth0
sed -i  s#IPADDR=.*#IPADDR=172.16.1.$m#g /etc/sysconfig/network-scripts/ifcfg-eth1

#cat /etc/sysconfig/network-scripts/ifcfg-$filenameshow

service network restart
#ifdown $filenameshow
#ifup $filenameshow
####################   change hostname

newname=0
echo "you will change hostname"
read -p "hostname=" hostname
sed -i s#HOSTNAME=.*#HOSTNAME=$hostname#g /etc/sysconfig/network
cat /etc/sysconfig/network
hostname $hostname

####################    yum   makecache

rm -rf /etc/yum.repos.d/epel.repo /etc/yum.repos.d/epel-testing.repo
yum makecache



####################   /bin/bash
/bin/bash